{{ define "main" }}

<!-- checking blog -->
{{ if or (or (eq .Section "post") (eq .Section "blog")) (or (eq .Section "categories") (eq .Section "tags") )}}

<section class="news section">
	<div class="container">
		<div class="row mt-30">
			<div class="col-lg-8 col-md-10 mx-auto">
				<div class="block">
					<div class="row">
            {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
            {{ range $paginator.Pages }}
						<div class="col-md-6 col-10 m-auto">
							<div class="blog-post">
								<div class="post-thumb">
									<a href="{{ .Permalink }}">
										<img src="{{ .Params.image | absURL }}" alt="{{ .Title }}" class="img-fluid">
									</a>
								</div>
								<div class="post-content">
									<div class="date">
										<h4>{{ .PublishDate.Format "02" }}<span>{{ .PublishDate.Format "Jan" }}</span></h4>
									</div>
									<div class="post-title">
										<h2><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h2>
									</div>
									<div class="post-meta">
										<ul class="list-inline">
											<li class="list-inline-item">
												<i class="fa fa-user"></i>
												<a href="{{ .Params.author_id | absURL }}">{{ .Params.author }}</a>
											</li>
											<li class="list-inline-item">
                        <i class="fa fa-tag"></i>
                        {{ range .Params.tags }}
                        <a href="{{ `tags/` | relLangURL }}{{ . | urlize | lower }}">{{. | humanize}}</a>
                        {{ end }}
											</li>
										</ul>
									</div>
								</div>
							</div>
            </div>
            {{ end }}
            <div class="col-12">
              {{ template "_internal/pagination.html" . }}
            </div>
					</div>
				</div>
			</div>
			<div class="col-lg-4 col-md-10 mx-auto">
				{{partial "blog-sidebar.html" . }}
			</div>
		</div>
	</div>
</section>

<!-- regular page -->
{{ else }}
{{ partial "page-header.html" . }}
<section class="section">
  <div class="container">
    <div class="row">
      <div class="col-lg-10 mx-auto">
        <div class="content">
          {{.Content}}
        </div>
      </div>
    </div>
  </div>
</section>
{{ end }}
<!-- /regular page -->

{{ end }}